package com.example.calculator;

import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.widget.TextView;
import android.widget.Toast;

import androidx.appcompat.app.AppCompatActivity;
public class HelpActivity extends AppCompatActivity {
    private TextView find;

    public void onCreate(Bundle icicle) {
        super.onCreate(icicle);
        setContentView(R.layout.activity_help);
        find = (TextView)findViewById(R.id.text);
    }
    public boolean onCreateOptionsMenu(Menu menu) {
        getMenuInflater().inflate(R.menu.main,menu);
        return true;
    }
    public boolean onOptionsItemSelected(MenuItem item) {
        int id = item.getItemId();
        switch (id) {
            case R.id.add_item:
                Toast.makeText(this, "普通计算器", Toast.LENGTH_SHORT).show();
                Intent intent=new Intent(HelpActivity.this, HelloWorldActivity.class);
                startActivity(intent);
                break;
            case R.id.remove_item:
                Toast.makeText(this, "科学计算器", Toast.LENGTH_SHORT).show();
                Intent intent1=new Intent(HelpActivity.this,SecondActivity.class);
                startActivity(intent1);
                break;
            case R.id.changdu:
                Toast.makeText(this, "进制转换", Toast.LENGTH_SHORT).show();
                Intent intent2=new Intent(HelpActivity.this, ThirdActivity.class);
                startActivity(intent2);
                break;
            case R.id.length:
                Toast.makeText(this, "长度转换", Toast.LENGTH_SHORT).show();
                Intent intent3=new Intent(HelpActivity.this,LengthActivity.class);
                startActivity(intent3);
                break;
            case R.id.volume:
                Toast.makeText(this, "体积转换", Toast.LENGTH_SHORT).show();
                Intent intent4=new Intent(HelpActivity.this,VolumeActivity.class);
                startActivity(intent4);
                break;
            case R.id.text:
                Toast.makeText(this,"帮助",Toast.LENGTH_SHORT).show();
                break;
            default:
        }
        return super.onOptionsItemSelected(item);
    }
}
